package com.xxl.job.admin.service;

import com.xxl.job.admin.core.model.XxlJobGroup;
import com.xxl.job.admin.core.model.XxlJobInfo;
import com.xxl.job.core.biz.model.ReturnT;

/**
 * xxl job 执行器 服务
 *
 * @author liangqm
 * @date 2018-07-23 8:18:18
 * @since v1.0.3
 */
public interface JawsJobGovernService {

	/**
	 * 获取执行器ID，如果执行器不存在，插入记录并返回ID
	 *
	 * @param xxlJobGroup xxl job 执行器信息
	 * @return xxlJobGroupID
	 * @author liangqm
	 * @date 2018-07-23 8:18:18
	 * @since v1.0.3
	 */
	Integer obtainJobExecutorId(XxlJobGroup xxlJobGroup);

	/**
	 * 自动注册 jobHandler
	 * 1.之前没有记录直接插入
	 * 2.之前有记录，更新后插入
	 *
	 * @param xxlJobInfo jobHandler信息
	 * @return XxlJobInfo
	 * @author liangqm
	 * @date 2018-07-23 8:18:18
	 * @since v1.0.3
	 */
	XxlJobInfo registerJob(XxlJobInfo xxlJobInfo);
}
